package com.csust.automaticteach.model.enums;

import lombok.Getter;

/**
 * @ClassNameGenerateTypeEnum
 * @Description TODO
 * @Author钰玟
 * @Date2025/7/24 下午3:50
 * @Version 1.0
 **/
@Getter
public enum GenerateTypeEnum {
    QUESTION("question", 1),
    EXAMINATION("examination", 2);

    private final String text;
    private final Integer value;

    GenerateTypeEnum(String text, Integer value) {
        this.text = text;
        this.value = value;
    }

    public static Integer getValueByText(String text) {
        for (GenerateTypeEnum value : GenerateTypeEnum.values()) {
            if (value.getText().equals(text)) {
                return value.getValue();
            }
        }
        return null;
    }
}
